package com.etsoft.comm.generate;

import com.etsoft.comm.tool.*;

public class Render2_ServiceImpl {

	public static void create(GContext gCtx) throws Exception {
		String fileStr = gCtx.getSampleStr(SampleFile.ServiceImpl);

		// ★ 开始拼字符串
		fileStr = fileStr.replace("##DaoClassName#", gCtx.getClassNameSuffix(SampleFile.Mapper));
		fileStr = fileStr.replace("##ModelClassName#", gCtx.getClassNameSuffix(SampleFile.Model));
		fileStr = fileStr.replace("##ServiceClassName#", gCtx.getClassNameSuffix(SampleFile.IService));
		fileStr = fileStr.replace("##ServiceImplClassName#", gCtx.getClassNameSuffix(SampleFile.ServiceImpl));
		// fileStr = fileStr.replace("##pkFieldCamel#", StringUnit.getCamelName(gCtx.getPK(), false));
		fileStr = fileStr.replace("##project_name#", gCtx.project_name);

		// 输出内容
		FileHelper.writeFile(gCtx.getFileFullPath(SampleFile.IService), gCtx.getTable_name(), fileStr);
	}

}
